import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: ()=>import('../views/Home.vue')
  },
  {
    path:'/login',
    name:'Login',
    component:()=>import('../views/Login.vue')
  },
  {
    path:'/register',
    name:'Register',
    component:()=>import('../views/Register.vue')
  },
  {
    path:'/fenlei',
    name:'Fenlei',
    component:()=>import('../views/Fenlei.vue')
  },
  {
    path:'/mine',
    name:'Mine',
    component:()=>import('../views/Mine.vue')
  },
  {
    path:'/gouwuche',
    name:'Gouwuche',
    component:()=>import('../views/Gouwuche.vue')
  },
  {
    path:'/bsty',
    name:'BSTY',
    component:()=>import('../views/Bsty.vue')
  },
  {
    path:'/bxyy',

    name:'Bxyy',
    component:()=>import('../views/Bxyy.vue')
  },
  {
    path:'/nxff',
    name:'Nxff',
    component:()=>import('../views/Nxff.vue')
  },
  {
    path:'/about',
    name:'About',
    component:()=>import('../views/About.vue')
  },
  {
    meta: {
      title: '详情页'
    },
    path: '/news/:nid',
    props: true,
    name: 'NewsDetails',
    component: () => import('../views/read.vue'),
  },
  {
    path: '/buy',
    name: 'Buy',
    component: ()=>import('../views/buy.vue')
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
